{% extends 'demo/base.html' %}
{% load common_extras %}
{% block title %}
    {{ now_classes|capfirst }}博客-{{ block.super }}
{% endblock %}
{% block header %}
    {% include 'demo/header.html' %}
{% endblock %}
{% block main%}
    {% include 'demo/classes.html' %}
    {% if articles %}
        <ul class="navs">
        {% for article in articles %}
            <li>
                <div class="left">
                    <a href="/demo/article/{{ article.id }}/">
                        <h4>{{ forloop.counter }}、{{ article.title }}</h4>
                    </a>
                    <a href="/demo/article/{{ article.id }}/" class="desc">
                        {{ article.desc }}
                    </a>
{#                    <p class="info">于{{ article.create_time|date:'Y年m月d日H:i:s' }}发布</p>#}
                    <p class="info">于{{ article.create_time|time_since }}发布</p>
                </div>
                <div class="right">
                    <img src="/media/{{ article.cover }}" alt="">
                </div>
            </li>
            {% if forloop.last %}
                <div class="bottom-info">文章已经是最后一篇了！！！</div>
            {% endif %}
        {% endfor %}

    {% else %}
        <div class="bottom-info">该分类暂时没有文章内容~</div>
    {% endif %}
</ul>
{% endblock %}

